<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>
    //作用域链：内部函数访问外部函数的变量。采取链式的查找方式来去这个值，就近原则
    function f1(){
        var num = 123;
        function f2(){
            console.log(num);
        }f2();
    }
    var num = 456;
    f1();
</script>
<body>
    
</body>
</html>